Repository navigation
probe: fix unsigned dma_request_channel() error check - #11463
Open
Shrusti-pk wants to merge 1 commit into
Open
Shrusti-pk wants to merge 1 commit into
Shrusti-pk wants to merge 1 commit into
Conversation
probe_dma_init() stores the int returned by dma_request_channel() in its uint32_t channel variable, so the "channel < 0" check after it can never be true. The requested channel is the v_index of the node_id the host passes in the probe module init payload or in INJECTION_DMA_ADD. When that channel does not exist on the host DMA controller or is already in use, dma_request_channel() returns -EINVAL, and the error is used as an index into dmac->chan[]: on the 32-bit DSP this points 22 entries before the heap allocated array. probe_dma_init() then reports success, and the index read from that memory is passed to dma_config(), dma_start(), dma_reload() and dma_stop(), which only assert on the channel number. Check the return value in the existing int err and index chan[] with it, as the other dma_request_channel() callers do.
Shrusti-pk
requested review from
dbaluta,
kv2019i,
lbetlej,
lgirdwood,
mmaka1 and
plbossart
as code owners
November 15, 2026 16:14
Collaborator
|
Can one of the admins verify this patch?
|
PR 11463: test resultsRun date: 2026-11-16 16:48 UTC Tested commit: 17ff0269d3aba89641ee819ccd217401be3c267d |
kv2019i
requested changes
Nov 16, 2026
kv2019i
left a comment
Collaborator
There was a problem hiding this comment.
Code change good but signed-off is missng
| @@ -237,12 +237,12 @@ __cold static int probe_dma_init(struct probe_dma_ext *dma, uint32_t direction) | |||
| if (err < 0) | |||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
probe_dma_init() keeps the dma_request_channel() result in a uint32_t, so its "channel < 0" check never fires (clang: -Wtautological-unsigned-zero-compare):
Every other dma_request_channel() / sof_dma_request_channel() caller already keeps the result in an int. Not tested on hardware.